// const app = require('./request/http.js')
const cors = require('cors') 
const express = require('express')
const userRouter = require('./router/index.js')
const ws =  require('./request/ws')
const akCookie = require('./assets/js/akCookie')
// const wsserver = require('./request/wsserver')


// 开启websocket客户端
ws.linkStart()
// 开启websocket服务端
// wsserver.wsserverlink()
akCookie.firstLink()

const app = express()
app.use(cors())
app.use(express.urlencoded({ extended: false }))
app.use('', userRouter)
app.use(express.static(__dirname + '/public' ));
app.listen(8888, function () {   
    console.log('server is running at http://127.0.0.1:8888') 
})


process.on('exit', () => {
    
});


// getGacha()